class_name EntityState
extends AtomicState

#region 属性
@export_flags("目标","障碍") var valid_detector_type = 0
@export_flags("移动","攻击","使用技能","交互","翻转","更新","造成伤害","受到伤害","恢复","选择目标","被选择","被击退") 
var invalid_entity_ability = 0
var controller:EntityControllerComponent
var detect_component:DetectComponent
var ability_component:AbilityComponent
var _diff_ability:GameEnum.EntityAbility
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
func state_init(fsm:FSM):
	super.state_init(fsm)
	controller = fsm.cur_owner as ControllerComponent
	detect_component = controller.cur_entity.get_component_by_name("DetectComponent")
	ability_component = controller.cur_entity.get_component_by_name("AbilityComponent")
func on_enter(from_state:State):
	super.on_enter(from_state)
	detect_component.control_all_detector(false)
	detect_component.control_detector_by_type(valid_detector_type,true)
	_diff_ability = ability_component.set_ability(invalid_entity_ability,false)
func on_update(delta:float):
	super.on_update(delta)
func on_physics_update(delta:float):
	super.on_physics_update(delta)
func on_exit(to_state:State):
	detect_component.control_all_detector(false)
	ability_component.set_ability(_diff_ability,true)
	super.on_exit(to_state)
func get_state_status() -> GameEnum.StateStatus:
	return super.get_state_status()
#endregion
#region 公共方法
#endregion
#region 私有方法
#endregion
#region 生命周期函数
#endregion
